-
-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1580 Create remote sketch #1581
Conversation
05c554f
to
942d974
Compare
fb544f9
to
1e17ed5
Compare
arduino-ide-extension/src/electron-browser/theia/core/electron-main-menu-factory.ts
Show resolved
Hide resolved
I have two requests:
@kittaakos @91volt what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When creating a new remote sketch with multiple IDE windows open, only the sketchbook in the current window is updated to show the newly created item. I need to perform a manual refresh to see the change:
Screen.Recording.2022-11-03.at.16.44.49.mov
This doesn't match the behaviour of the local sketchbook, which shows the new sketch in all the windows as soon as it is saved:
Screen.Recording.2022-11-03.at.16.46.44.mov
Yes, but it's the same as with 2.0.1, if you sync one window, you do not sync the other window. no_polling.mp4
IDE2 can poll, but we did not plan the remote sketches with polling on purpose. Users can sync. |
I wasn't thinking of a polling, I thought we could make use of an event to tell every client that they should update the tree. To me it makes sense because we are aware of when a remote sketch is created from the IDE2, so we could easily update every client. I'm not suggesting to update the tree also when a remote sketch is created from the webide. @kittaakos what do you think about that? |
Are you aware that IDE2 generates the new remote sketch on the client? |
I am. In order to do that we should either interact with the backend (which means creating a new service I guess) or with electron-main (which probably means making use of IPC messages).
Maybe I used the word "easily" a little lightly here, since of course it's not just as easy as listening to a simple event. But still it shouldn't be so complicated right? Anyway, to me we could also add this as an improvement later on if you prefer it, as it is outside the scope of this PR. |
OK. Let's do that. |
👍 I do not have a strong preference for this. We can do it.
Probably no. IDE2 never advertised its features via the Command Palette, and I do not want to open Pandora's box in the context of this PR. Please open a follow-up if you're interested in implementing it. Just because IDE2 can have yet another way to create a sketch, it does not necessarily have to have it. One can create a sketch from a keybinding, the sketchbook, and the |
We do the followings:
|
local_sketchbook.mp4Update: Alberto helped me to figure out the update does not work on my env due to #1600. After fixing the invalid sketch name, IDE2 works as described in #1581 (review). Thank you! |
89e6776
to
91dcdb0
Compare
|
Please review. Thank you! |
@kittaakos Testing it in production, the only issue I see is the missing user feedback after inserting the cloud sketch name and before the sketch is open. After naming, takes around 14 secs for the sketch to get pulled, and ~20s to open the workspace (video); a solution could be an extra step in the dialog after inserting the name, showing a spinner while the sketch get created and pulled, similarly to what we do in the firmware updater (screenshot) @davegarthsimpson @ubidefeo @AlbyIanna @kittaakos Registrazione.schermo.2022-11-09.alle.16.24.34.mov |
It exists. The UX is precisely the same as when users manually sync the sketch. It's in the Remote Sketchbook, showing as create_sync.mp4
Why block the UI? Why does IDE2 not show a progress notification in the right corner? Showing definite or indefinite progress this way is known by the users: it works for lib and platform installation/uninstallation and verify/upload. Can we stick to that? |
Because the user is going to be dragged out of focus as soon as the new workspace appears, and it takes about 20s: is a bit annoying if we consider that, the user start writing a line of code, and as soon the sketch get pulled is dragged out of focus.
|
I'd like to avoid blocking the UI if possible. Maybe we can handle it in a non-blocking notification with a loading indicator or something like that. But anyway, I agree that we can discuss this separately. This PR looks already good for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it again and it works great for me. Also code is good of course.
Thank you @kittaakos for addressing my remarks!
arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-tree-model.ts
Outdated
Show resolved
Hide resolved
Closes #1580 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Motivation
To create a remote sketch from IDE2 without opening https://create.arduino.cc/editor in a browser.
Change description
File
>New
has been renamed toFile
>New Sketch
.New menu item to create a remote sketch from IDE2:
File
>New Remote Sketch
.Advanced
>Show/Hide Remote Sketchbook
or"arduino.cloud.enabled": false
insettings.json
)Can create a new sketch from the sketchbook.
new_local_sketch.mp4
When logged in to Arduino Cloud and the Remote Sketchbook is not hidden, can create a new remote sketch from the Sketchbook.
create_remote_sketch.mp4
Remote sketch creation gracefully handles conflicts (HTTP 409)
handles_conflict.mp4
After creating the new remote sketch, IDE2 asks if the sketch has to be pulled and opened in a new window.Yes
will pull the remote sketch content and open the sketch in a new window.SelectAlways
if you want to pull the remote sketch automatically and open it in a new window.SelectNever
to never do anything automatically after the remote sketch creation. Don't worry, you can still pull your sketch manually and open it.You can re-configure the behavior of the notification by tuning the newarduino.cloud.sketchOpenStrategy
advanced setting. The possible values are"Ask"
,"Never"
, and"Always"
. The default is"Ask"
.After creating the new remote sketch, IDE2 pulls and opens it in a new window.
After the remote sketch creation, IDE2 pulls the content, opens the new window, and reveals the sketch in the Remote Sketchbook widget.
create_new_remote_and_open.mp4
Handles gracefully when there is a mid-air deletion before the pull and open.
handles_deletion.mp4
Other information
Closes #1580
Reviewer checklist